//
//  ZGrantDealCell.m
//  DistributorAB
//
//  Created by LZY on 2019/10/17.
//  Copyright © 2019 主事丫环. All rights reserved.
//

#import "ZGrantDealCell.h"

@implementation ZGrantDealCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setupViewAction];
    }
    return self;
}
#pragma mark - 界面布局
- (void)setupViewAction{
    
    self.contentView.backgroundColor = kColorWithHex(0xf2f2f2);
    
    CGFloat preWidth = (kScreen_Width - kScaleNum(310)) / 4.0;
    
    UIButton *btnRefuse = [UIButton buttonWithType:UIButtonTypeCustom];
    btnRefuse.frame = CGRectMake(preWidth, 20, kScaleNum(155), 48);
    [btnRefuse setTitle:@"不通过" forState:UIControlStateNormal];
    [btnRefuse setTitleColor:kColorWithHex(0xffffff) forState:UIControlStateNormal];
    [btnRefuse setBackgroundColor:kColorWithHex(0x70be68)];
    btnRefuse.titleLabel.font = [UIFont systemFontOfSize:16];
    btnRefuse.tag = 200;
    [btnRefuse addTarget:self action:@selector(btnClickAction:) forControlEvents:UIControlEventTouchUpInside];
    btnRefuse.layer.cornerRadius = 4;
    btnRefuse.layer.masksToBounds = YES;
    [self.contentView addSubview:btnRefuse];
    
    UIButton *btnOk = [UIButton buttonWithType:UIButtonTypeCustom];
    btnOk.frame = CGRectMake(kScreen_Width - preWidth - kScaleNum(155), 20, kScaleNum(155), 48);
    [btnOk setTitle:@"通过" forState:UIControlStateNormal];
    [btnOk setTitleColor:kColorWithHex(0xffffff) forState:UIControlStateNormal];
    [btnOk setBackgroundColor:kColorWithHex(0x70be68)];
    btnOk.titleLabel.font = [UIFont systemFontOfSize:16];
    btnOk.tag = 201;
    [btnOk addTarget:self action:@selector(btnClickAction:) forControlEvents:UIControlEventTouchUpInside];
    btnOk.layer.cornerRadius = 4;
    btnOk.layer.masksToBounds = YES;
    [self.contentView addSubview:btnOk];
}
#pragma mark - 交互事件
- (void)btnClickAction:(UIButton *)sender{
    if (self.delegate && [self.delegate respondsToSelector:@selector(grantDealCellBtnClick:)]) {
        [self.delegate grantDealCellBtnClick:sender.tag];
    }
}
+ (CGFloat)cellHeight{
    return 130;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
